package me.shurufa.holder;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import butterknife.Bind;
import butterknife.ButterKnife;
import me.shurufa.R;
import me.shurufa.model.Catalog;

/**
 * 在此写用途
 *
 * @FileName: me.shurufa.holder.CatalogNoNumViewHolder.java
 * @author: kHRYSTAL
 * @email: 723526676@qq.com
 * @date: 2016-02-02 16:50
 */
public class MyDigestBookViewHolder extends BaseViewHolder {

    @Bind(R.id.catalog_title)
    TextView catalogTitle;

    private Context mContext;
    private Catalog mCatalog;

    public MyDigestBookViewHolder(View itemView, Object parent) {
        super(itemView, parent);
        mContext = itemView.getContext();
        ButterKnife.bind(this,itemView);
    }

    public void bind(Catalog catalog) {
        if (catalog==null)
            return;
        mCatalog = catalog;
        if (!TextUtils.isEmpty(catalog.title))
            catalogTitle.setText(catalog.title);
        else
            catalogTitle.setText("");
    }
}
